<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>查看评论</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/static/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form">
    <input type="hidden" class="reId" id="reId"/>
</form>
<div class="layui-container" id="comments">

</div>
</body>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript">
    layui.use(['jquery','element','form'],function () {
        var element = layui.element,
            form = layui.form,
            $ = layui.jquery;

        $.ajax({
            url: '/commentController/list',
            type: 'GET',
            // data: {reId: $("#reId").val},
            success: function (res) {
                if (res.code === 200) {
                    var ele = "";
                    $.each(res.data, function (index, item) {
                            ele += " <div class=\"layui-row layui-col-space10\">\n" +
                                "        <span class=\"layui-col-xs10 layui-col-xs-offset1\">" + item.comments + "</span>\n" +
                                "    </div>";
                    });
                    $("#comments").append(ele);
                }
            }
        });
    });

</script>